package com.xdf.ecommerce.feign;

import com.xdf.ecommerce.account.BalanceInfo;
import com.xdf.ecommerce.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 用户账户扣减 feign 客户端
 * contextId 相当于 BeanId
 * value 被调用的微服务名称 = bootstrap.yml#spring.application.name
 * 本接口中的方法同微服务 e-commerce-account-service 中的 controller 中的方法
 * @author chanchaw
 * @create 2025-11-11 16:43
 */
@FeignClient(contextId = "NotSecuredBalanceClient", value = "e-commerce-account-service")
public interface NotSecuredBalanceClient {
    @PostMapping("/ecommerce-account-service/balance/deductBalance")
    CommonResponse<BalanceInfo> deductBalance(@RequestBody BalanceInfo balanceInfo);
}
